import request from '@/utils/request'

// 创建预约
export function createAppointment(data) {
  return request({
    url: '/lfd/appointment/create',
    method: 'post',
    data: data
  })
}

// 更新预约
export function updateAppointment(data) {
  return request({
    url: '/lfd/appointment/update',
    method: 'put',
    data: data
  })
}

// 删除预约
export function deleteAppointment(id) {
  return request({
    url: '/lfd/appointment/delete?id=' + id,
    method: 'delete'
  })
}

// 获得预约
export function getAppointment(id) {
  return request({
    url: '/lfd/appointment/get?id=' + id,
    method: 'get'
  })
}

// 获得预约分页
export function getAppointmentPage(query) {
  return request({
    url: '/lfd/appointment/page',
    method: 'get',
    params: query
  })
}
// 预约状态
export function getAppointmentStatus() {
  return request({
    url: '/lfd/appointment/status',
    method: 'get',
  })
}

// 导出预约 Excel
export function exportAppointmentExcel(query) {
  return request({
    url: '/lfd/appointment/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 统计
export function appointmentStatics(query) {
  return request({
    url: '/lfd/appointment/appointment-statistic',
    method: 'get',
    params: query
  })
}
